package ex1;

//简单食物工厂
public class SimpleFoodFactory {

    public static Eatable getFood(String name){
        if(name.equals("apple")){
            return new Apple();
        }else if(name.equals("banana")){
            return new Banana();
        }else if(name.equals("orange")){
            return new Orange();
        }else if(name.equals("meat")){
            return new Meat();
        }
        return null;
    }
}
